package org.biubiu0002.baiblog.core.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.biubiu0002.baiblog.core.model.entity.ShareEntity;

import java.util.List;

/**
 * 分享内容表
 * 
 * @author biubiu0002
 * @email 1007918011@qq.com
 * @date 2022-05-06 00:50:37
 */
@Mapper
public interface ShareDao extends BaseMapper<ShareEntity> {

    /**
     * 更新推文状态
     * @param shareId 推文id
     * @param status 状态
     */
    void updateShareStatus(@Param("shareId") String shareId, @Param("status") Integer status);

    /**
     * 更新推文状态
     * @param shareIdList 推文idList
     * @param status 状态
     */
    void updateShareListStatus(@Param("list") List<String> shareIdList, @Param("status") Integer status);

    /**
     * 根据关注人列表获取feedId列表
     * @param followList 关注人列表
     * @param timestamp 创建时间
     * @return shareList
     */
    List<ShareEntity> loadFeedByFollowsByCreateTime(@Param("followList") List<String> followList, @Param("timestamp") Long timestamp);
}
